import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 首页
import Home from '@/views/home'
import Goods from '@/views/goods'

const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    component: Home,
    redirect: '/home/goods',
    children: [
      {
        path: '/home/goods',
        component: Goods
      },
      {
        path: '/home/evaluate',
        component: () => import('@/views/evaluate')
      },
      {
        path: '/home/shop',
        component: () => import('@/views/shop')
      }
    ]
  },
  {
    name: 'detail',
    path: '/detail',
    component: () => import('@/views/detail')
  }
]

const router = new VueRouter({
  routes
})

export default router
